<?php
/**
 * Created by PhpStorm.
 * User: lgy
 * Date: 2018/5/27
 * Time: 16:51
 */

namespace app\index\controller;
use think\View;
use app\index\model\Admin AS AdminModel;
class Admin
{
	public function admin(){
		$view = new View();
		return $view->fetch('admin');
	}
	public function getEnroll(){
		$result = $this->dealTime(AdminModel::getEnroll());
		return json($result);
	}
	public function getOrder(){
		$result = $this->dealTime(AdminModel::getOrder());
		return json($result);
	}
	public function dealTime($data){
		foreach ($data as $k=>$value){
			$data[$k]['create_time']= date('Y-m-d H:i:s',$value['create_time']);
		}
		return $data;
	}
}